package main

import (
	"github.com/savsgio/atreugo/v11"
	_ "homePageTemplate/dataInit"
	"homePageTemplate/route"
	_ "homePageTemplate/route"
	"homePageTemplate/variable"
)

func main()  {

	if variable.Db != nil {
		db, _ := variable.Db.DB()
		defer db.Close()
	}

	config := atreugo.Config{
		Addr: "0.0.0.0:7009",
	}
	variable.Server = atreugo.New(config)

	route.NewHomePageTemplateRoute().RouteInit()

	if err := variable.Server.ListenAndServe(); err != nil {
		panic(err)
	}
}
